| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322 |
- import { notFound } from "next/navigation";
- import secondselfShot from "@/assets/projects/secondself.webp";
- import { BentoGrid, type BentoItem } from "@/components/bento/bento-grid";
- import { ArtifactsCard } from "@/components/cards/artifacts";
- import { EmojiCard } from "@/components/cards/emoji";
- import { FinOpsCard } from "@/components/cards/finops";
- import { GlobeCard } from "@/components/cards/globe";
- import { HeroCard } from "@/components/cards/hero";
- import { MiniCard } from "@/components/cards/mini-card";
- import { PackBookCard } from "@/components/cards/packbook";
- import { PhotoDeck } from "@/components/cards/photo-deck";
- import { ProjectCard } from "@/components/cards/project";
- import { SkyCard } from "@/components/cards/sky";
- import { TechSphere } from "@/components/cards/tech-sphere";
- import { WritingCard, type PostSummary } from "@/components/cards/writing";
- import { projects } from "@/config/site";
- import { getHomeData } from "@/lib/data";
- import { isLocale } from "@/lib/i18n";
- import { getMessages } from "@/messages";
- // Static, refreshed hourly: the Firebase image URLs are baked in.
- export const revalidate = 3600;
- export default async function Page({
- params,
- }: {
- params: Promise<{ lang: string }>;
- }) {
- const { lang } = await params;
- if (!isLocale(lang)) notFound();
- const t = getMessages(lang);
- const home = await getHomeData();
- // Articles are emptied for now: no Notion request and no post list. The
- // pipeline stays in lib/notion.ts for when they come back.
- const posts: PostSummary[] = [];
- // A project's name and link from the config, its words in this language.
- const project = (id: keyof typeof projects) => ({
- ...projects[id],
- ...t.projects[id],
- });
- // Order matters: cards pack first-fit in this order. Sizes are columns × rows
- // on phones (2 columns, below the hero's header row), wide phones (2), small
- // tablets (2), tablets (3), and desktops (4).
- // On tablets:
- // [hero ][sky ]
- // [hero ][globe]
- // [finops ]
- // [artifacts ]
- // [secondself][pack ]
- // [photos ][pack ]
- // [photos ][web ]
- // [chatbot ][web ]
- // [tech][mini][emoji]
- // [paper][writing ]
- // On desktop:
- // [hero ][finops ]
- // [hero ][artifacts ]
- // [sky][globe][secondself]
- // [pack][photos ][web]
- // [pack][photos ][web]
- // [chatbot ][tech][mini]
- // [emoji][paper][writing ]
- // Cards 1 / 2 / 4 are blank placeholders for now. Their components and the
- // original JSX stay right here; flip a flag to true to bring one back.
- const show = {
- finops: false,
- artifacts: false,
- secondself: false,
- writing: false,
- packbook: false,
- photos: true,
- chatbot: false,
- emoji: false,
- paper: false,
- };
- const items: BentoItem[] = [
- {
- id: "hero",
- tags: ["about"],
- label: t.cards.hero,
- size: [
- [2, 1],
- [2, 2],
- [2, 2],
- [2, 2],
- [2, 2],
- ],
- still: true,
- // Below 768px a full-width header row as tall as its content (the first
- // three sizes go unused).
- header: true,
- content: (
- <HeroCard avatarUrl={home.avatarUrl} dogUrl={home.dogUrl} lang={lang} />
- ),
- },
- {
- id: "finops",
- tags: ["work"],
- label: "AWS FinOps Agent",
- size: [
- [2, 2],
- [2, 2],
- [2, 1],
- [3, 1],
- [2, 1],
- ],
- content: show.finops ? <FinOpsCard /> : null,
- },
- {
- id: "artifacts",
- tags: ["work"],
- label: "Amazon Q artifacts",
- size: [
- [2, 2],
- [2, 2],
- [2, 1],
- [3, 1],
- [2, 1],
- ],
- content: show.artifacts ? <ArtifactsCard /> : null,
- },
- {
- id: "sky",
- tags: ["about"],
- label: t.cards.sky,
- size: [
- [1, 1],
- [1, 1],
- [1, 1],
- [1, 1],
- [1, 1],
- ],
- content: <SkyCard />,
- },
- {
- id: "globe",
- tags: ["about"],
- label: t.cards.globe,
- size: [
- [1, 1],
- [1, 1],
- [1, 1],
- [1, 1],
- [1, 1],
- ],
- content: <GlobeCard />,
- },
- {
- id: "secondself",
- tags: ["work"],
- label: projects.secondself.name,
- size: [
- [2, 1],
- [2, 1],
- [2, 1],
- [2, 1],
- [2, 1],
- ],
- content: show.secondself ? (
- <ProjectCard
- image={secondselfShot}
- look="secondself"
- lang={lang}
- project={project("secondself")}
- />
- ) : null,
- },
- {
- id: "packbook",
- tags: ["work"],
- label: "PackBook",
- size: [
- [2, 2],
- [2, 2],
- [1, 2],
- [1, 2],
- [1, 2],
- ],
- content: show.packbook ? <PackBookCard /> : null,
- },
- {
- id: "photos",
- tags: ["about"],
- label: t.cards.photos,
- size: [
- [2, 2],
- [2, 2],
- [2, 2],
- [2, 2],
- [2, 2],
- ],
- content: show.photos ? <PhotoDeck photos={home.photos} /> : null,
- },
- {
- id: "webagent",
- tags: ["work"],
- label: projects.webagent.name,
- size: [
- [1, 2],
- [1, 2],
- [1, 2],
- [1, 2],
- [1, 2],
- ],
- content: (
- <ProjectCard
- height={800}
- image={home.webagentUrl}
- lang={lang}
- link={false}
- look="webagent"
- project={project("webagent")}
- width={1000}
- />
- ),
- },
- {
- id: "chatbot",
- tags: ["work"],
- label: projects.chatbot.name,
- size: [
- [2, 1],
- [2, 1],
- [2, 1],
- [2, 1],
- [2, 1],
- ],
- content: show.chatbot ? (
- <ProjectCard
- height={1280}
- image={home.chatbotUrl}
- look="chatbot"
- lang={lang}
- project={project("chatbot")}
- width={2629}
- />
- ) : null,
- },
- {
- id: "tech",
- tags: ["about", "work"],
- label: t.cards.tech,
- size: [
- [1, 1],
- [1, 1],
- [1, 1],
- [1, 1],
- [1, 1],
- ],
- content: <TechSphere />,
- },
- {
- id: "mini",
- tags: ["about"],
- label: t.cards.mini,
- size: [
- [1, 1],
- [1, 1],
- [1, 1],
- [1, 1],
- [1, 1],
- ],
- content: <MiniCard />,
- },
- {
- id: "emoji",
- tags: ["work"],
- label: t.cards.emoji,
- size: [
- [1, 1],
- [1, 1],
- [1, 1],
- [1, 1],
- [1, 1],
- ],
- content: show.emoji ? <EmojiCard /> : null,
- },
- {
- id: "paper",
- tags: ["work"],
- label: projects.paper.name,
- size: [
- [1, 1],
- [1, 1],
- [1, 1],
- [1, 1],
- [1, 1],
- ],
- content: show.paper ? (
- <ProjectCard
- height={1280}
- image={home.paperUrl}
- look="paper"
- lang={lang}
- project={project("paper")}
- width={1577}
- />
- ) : null,
- },
- {
- id: "writing",
- tags: ["about"],
- label: t.cards.writing,
- size: [
- [2, 2],
- [2, 2],
- [2, 1],
- [2, 1],
- [2, 1],
- ],
- content: show.writing ? (
- <WritingCard lang={lang} posts={posts} />
- ) : null,
- },
- ];
- return <BentoGrid items={items} />;
- }
|